package treqs.model;

// Generated 2009-jul-12 14:12:54 by Hibernate Tools 3.2.4.GA

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Taskstorequirements generated by hbm2java
 */
@Entity
@Table(name = "taskstorequirements", catalog = "treqs")
public class Taskstorequirements implements java.io.Serializable {

	private Integer id;
	private Tasks tasks;
	private Requirements requirements;
	private int requirementId;

	public Taskstorequirements() {
	}

	public Taskstorequirements(Tasks tasks, Requirements requirements,
			int requirementId) {
		this.tasks = tasks;
		this.requirements = requirements;
		this.requirementId = requirementId;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "requirements"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "taskID", nullable = false)
	public Tasks getTasks() {
		return this.tasks;
	}

	public void setTasks(Tasks tasks) {
		this.tasks = tasks;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Requirements getRequirements() {
		return this.requirements;
	}

	public void setRequirements(Requirements requirements) {
		this.requirements = requirements;
	}

	@Column(name = "requirementID", nullable = false)
	public int getRequirementId() {
		return this.requirementId;
	}

	public void setRequirementId(int requirementId) {
		this.requirementId = requirementId;
	}

}
